using System.Runtime.InteropServices;

namespace Recast
{
	public unsafe partial class RecastGlobal
	{
		[StructLayout(LayoutKind.Sequential)]
		public unsafe partial struct dtPoly
		{
			public uint firstLink;
			public fixed ushort verts[DT_VERTS_PER_POLYGON];
			public fixed ushort neis[DT_VERTS_PER_POLYGON];
			public ushort flags;
			public byte vertCount;
			public byte areaAndtype;
			public void setArea(byte a)
			{
				areaAndtype = (byte)((areaAndtype & 0xc0) | (a & 0x3f));
			}
			public void setType(byte t)
			{
				areaAndtype = (byte)((areaAndtype & 0x3f) | (t << 6));
			}
			public byte getArea()
			{
				return (byte)(areaAndtype & 0x3f);
			}
			public byte getType()
			{
				return (byte)(areaAndtype >> 6);
			}
		}
	}
}
